Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Use sccache in builds #10246

Closed
wants to merge 2 commits into from
Closed

[ci] Use sccache in builds #10246

wants to merge 2 commits into from

Conversation

driazati
Copy link
Member

@driazati driazati commented Feb 14, 2022

This sets the builds for each platform to use sccache as a build cache. For a fully cached rebuild, this reduces the time (in testing) from 30+ minutes to 1-2 minutes (e.g. if the build isn't touching any C++ files). We can run this for a while and if it is successful then remove the extra code around rebuilding using the existing on-instance build directory.

The sccache server is backed by an S3 bucket configured in tlc-pack/ci-terraform#3.

Example run: https://ci.tlcpack.ai/blue/organizations/jenkins/tvm/detail/PR-10353/5/pipeline/57

Copy link
Member

@Mousius Mousius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well this is very exciting 😸!

  • update tlc-pack/ci with terraform for public S3 bucket

Why do we need to have this public? Can't the instances assume a role to access it?

  • update docker images so they all have sccache

Are we just missing ci_cpu now? I think I got the others you added sccache to 😸

sccache --show-stats

# Use ninja as the builder for cmake
pip install --user ninja
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not apt-get install ninja-build rather than using pip here?

Copy link
Contributor

@leandron leandron Feb 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When these task_*.sh run, it is with a non-privileged user, so we can't apt-get in these scripts. Perhaps an alternative solution is to add Ninja in the Docker image in the docker/install/*.sh scripting rather install it for every single build job we run.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha! Yeah, that'd be much better than a side channel pip install thanks @leandron!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah installing in the image is definitely better, #10257 adds it (separate PR so we can land the images and then merge this one). I kept it with pip since the Ubuntu 18 ninja-build is pretty old (1.8, 2017) compared to the binaries in pip (1.10, 2020) and they should be equivalent otherwise

@Mousius Mousius self-assigned this Feb 15, 2022
driazati added a commit to driazati/tvm that referenced this pull request Feb 15, 2022
Following on from apache#10246, this moves the `pip install`-at-runtime deps to the docker image install so they are baked in.
@driazati
Copy link
Member Author

Why do we need to have this public? Can't the instances assume a role to access it?

Sorry public wasn't the right word, I meant OSS, we had spun this up in the octo-staging Jenkins to test. The bucket would be private to the runners. Though having a public-readable sccache bucket is potentially on the list of followups since it means anyone could benefit from the cached build.

Are we just missing ci_cpu now? I think I got the others you added sccache to 😸

Yup that's the only one, might be good to roll #10257 into the update too

driazati added a commit to driazati/tvm that referenced this pull request Feb 18, 2022
Following on from apache#10246, this moves the `pip install`-at-runtime deps to the docker image install so they are baked in.
@driazati driazati changed the title [skip ci][ci] Use sccache in builds [ci] Use sccache in builds Feb 22, 2022
driazati added a commit to driazati/ci that referenced this pull request Feb 22, 2022
This adds the secret to the config so apache/tvm#10246 will work
@driazati driazati force-pushed the use_scc branch 3 times, most recently from b4a80e9 to 1ee1a9b Compare February 22, 2022 23:14
@driazati driazati marked this pull request as ready for review February 22, 2022 23:38
@driazati driazati requested review from Mousius and leandron and removed request for a team February 22, 2022 23:39
@driazati
Copy link
Member Author

driazati commented Feb 22, 2022

cc @Mousius @areusch this is ready to go (after pushing to a branch), see #10353 for testing. I updated the build to work without ninja and use sccache only if present

driazati added a commit to driazati/tvm that referenced this pull request Feb 23, 2022
Following on from apache#10246, this moves the `pip install`-at-runtime deps to the docker image install so they are baked in.
driazati added a commit to driazati/tvm that referenced this pull request Feb 23, 2022
Following on from apache#10246, this moves the `pip install`-at-runtime deps to the docker image install so they are baked in.
@driazati driazati force-pushed the use_scc branch 2 times, most recently from bf45375 to fcf1534 Compare February 23, 2022 22:06
@driazati driazati force-pushed the use_scc branch 3 times, most recently from 12f6068 to 66f5c50 Compare March 1, 2022 20:14
@driazati driazati force-pushed the use_scc branch 8 times, most recently from 855f7bb to 7412ad9 Compare March 2, 2022 00:19
driazati added a commit to driazati/tvm that referenced this pull request Mar 2, 2022
Following on from apache#10246, this moves the `pip install`-at-runtime deps to the docker image install so they are baked in.
@driazati
Copy link
Member Author

driazati commented Mar 3, 2022

Closing in favor of #10359 which adds a proper -j to builds first

@driazati driazati closed this Mar 3, 2022
driazati added a commit to driazati/tvm that referenced this pull request Mar 4, 2022
Following on from apache#10246, this moves the `pip install`-at-runtime deps to the docker image install so they are baked in.
driazati added a commit to driazati/tvm that referenced this pull request Mar 4, 2022
Following on from apache#10246, this moves the `pip install`-at-runtime deps to the docker image install so they are baked in.

commit-id:5fe5152b
Mousius pushed a commit that referenced this pull request Mar 16, 2022
…10257)

Following on from #10246, this moves the `pip install`-at-runtime deps to the docker image install so they are baked in.
pfk-beta pushed a commit to pfk-beta/tvm that referenced this pull request Apr 11, 2022
…pache#10257)

Following on from apache#10246, this moves the `pip install`-at-runtime deps to the docker image install so they are baked in.
driazati added a commit to tlc-pack/ci that referenced this pull request May 31, 2022
This adds the secret to the config so apache/tvm#10246 will work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants